package com.qf.bigwork.fragment;


import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.PagerTabStrip;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.qf.bigwork.R;
import com.qf.bigwork.view.DetailsActivity;


/**
 * A simple {@link Fragment} subclass.
 * 北京
 */
public class BeijingFragment extends Fragment {
    private Toolbar toolbar;
    private TextView tv;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_beijing,null);
        initView(view);
        toolbarView();
        return view;
    }

    private void initView(View view) {
        toolbar = (Toolbar)view.findViewById(R.id.beijing_frag_tb);
        tv= (TextView) view.findViewById(R.id.beijing_frag_tv);
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), DetailsActivity.class));
            }
        });
    }
    private void toolbarView() {
        toolbar.setTitle("北京");
        toolbar.inflateMenu(R.menu.menu_search);
        toolbar.setBackgroundColor(Color.RED);
    }

}
